package com.sgcc.isc.config;

import com.sgcc.isc.service.I6000Service;
import com.sgcc.isc.service.IscService;
import com.sgcc.isc.service.MonitorService;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.xml.ws.Endpoint;



@Configuration
public class CxfConfig {
	@Autowired
    private Bus bus;

    @Autowired
    IscService iscService;
    
    @Autowired
    I6000Service i6000Service;

    @Autowired
    MonitorService monitorService;
    
    @Bean
    public Endpoint iscEndpoint() {
        EndpointImpl endpoint = new EndpointImpl(bus, iscService);
        endpoint.publish("/IscService");
        return endpoint;
    }
    
    @Bean
    public Endpoint I6000Endpoint() {
        EndpointImpl endpoint = new EndpointImpl(bus, i6000Service);
        endpoint.publish("/I6000Service");
        return endpoint;
    }

    @Bean
    public Endpoint MonitorServiceEndpoint() {
        EndpointImpl endpoint = new EndpointImpl(bus, monitorService);
        endpoint.publish("/MonitorService");
        return endpoint;
    }
}
